Skip to main content

TreeCases

TreeCases[tree,pattern] gives a list of subtrees of tree with data matching pattern.

TreeCases[tree,pattern,levelspec] gives a list of all subtrees of tree on levels specified by levelspec with data that matches the pattern.

TreeCases[tree,pattern,levelspec,n] gives the first n subtrees in tree with data that matches the pattern.

TreeCases[pattern] represents an operator form of TreeCases that can be applied to a tree.

Please visit the official Wolfram Language Reference for more details and examples on core symbols.